#include<bits/stdc++.h>

using namespace std;

int main() {
    freopen("J.txt", "r", stdin);
    int a[4][14];
    memset(a, 0, sizeof(a));
    int n;
    cin >> n;
    while (n--) {
        char kind;//SHCD
        int digit;//1 2 3 4 5 6 7 8 9 10 11 12 13
        cin >> kind >> digit;
        if (kind == 'S') {
            a[0][digit] = 1;
        }
        if (kind == 'H') {
            a[1][digit] = 1;
        }
        if (kind == 'C') {
            a[2][digit] = 1;
        }
        if (kind == 'D') {
            a[3][digit] = 1;
        }

    }
    for (int i = 1; i <= 13; i++) {
        if (a[0][i] == 0) {
            cout << "S " << i << endl;
        }
    }
    for (int i = 1; i <= 13; i++) {
        if (a[1][i] == 0) {
            cout << "H " << i << endl;
        }
    }

    for (int i = 1; i <= 13; i++) {
        if (a[2][i] == 0) {
            cout << "C " << i << endl;
        }
    }
    for (int i = 1; i <= 13; i++) {
        if (a[3][i] == 0) {
            cout << "D " << i << endl;
        }
    }
    return 0;
}
